package com.zhou.service;

import com.zhou.dao.StudentDAO;
import com.zhou.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("studentService")
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDAO studentDAO;

    @Override
    public List<Student> findStudentByMajorID(Integer MajorID) {
        return studentDAO.findStudentByMajorID(MajorID);
    }

    @Override
    public void addStudent(List<Student> students) {
        studentDAO.addStudent(students);
    }

    @Override
    public Long maxStudentId(Long prefix) {
        return studentDAO.maxStudentId(prefix);
    }

    @Override
    public void deleteStudent(Long id) {
        studentDAO.deleteStudent(id);
    }
}
